#include "split_by_char.h"

void split_by_char(const std::string& source, std::vector<std::string>& target, char c){
	size_t left=0;
	size_t right=0;

	while(left<source.size()){
		right=source.find_first_of(c, left);
        if(right=std::string::npos){
			break;
		}
		target.push_back(source.substr(left, (right-left)));
		right++;
		left=right;
	}
	right=source.size();
	target.push_back(source.substr(left, (right-left)));
	return;
}
